{% set pypi_name = 'octavia-lib' %}
{% set upstream_version = upstream_version('2.2.0') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}
%if 0%{?rdo}
%define skip_python2 1
%endif
Name:           {{ py2name(py_versions=['py3']) }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        A library to support Octavia provider drivers
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/octavia-lib
Source0:        {{ source }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('oslo.i18n') }}
BuildRequires:  {{ py3('oslo.log') }}
BuildRequires:  {{ py3('oslo.serialization') }}
BuildRequires:  {{ py3('oslo.utils') }}
BuildRequires:  {{ py3('oslotest') }}
BuildRequires:  {{ py3('pbr') }}
BuildRequires:  {{ py3('stestr') }}
BuildRequires:  {{ py3('tenacity') }}
Requires:       {{ py3('oslo.i18n') }}
Requires:       {{ py3('oslo.log') }}
Requires:       {{ py3('oslo.serialization') }}
Requires:       {{ py3('pbr') }}
Requires:       {{ py3('tenacity') }}
BuildArch:      noarch

%description
A library to support Octavia provider drivers.

This python module provides a python library for Octavia provider driver
developers.

%prep
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
%py_req_cleanup

%build
%{py3_build}

%install
%{py3_install}

%check
# we don't want to depend on hacking
rm -rf octavia_lib/tests/unit/hacking
python3  -m stestr.cli run

%files
%license LICENSE
%doc ChangeLog README.rst
%{python3_sitelib}/octavia_lib
%{python3_sitelib}/octavia_lib*egg-info

%changelog
